package com.zb.api.common.econts;


public enum WaresTypeEnum {

    LAMPS_LANTERNS(1, "灯具"),
    ELECTRIC_APPLIANCE(2, "电器"),
    FURNITURE(3, "家具"),
    HARDWARE(4, "五金"),
    BUILDING_MATERIAL(5, "建材"),
    OTHER(6, "其他")
  ;

    private String desc;
    private Integer value;

    WaresTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    public Integer getValue() {
        return value;
    }


    public static WaresTypeEnum valueOf(Integer value) {
        for (WaresTypeEnum statusEnum : values()) {
            if (statusEnum.getValue().equals(value)) {
                return statusEnum;
            }
        }
        throw new RuntimeException("没有找到对应的枚举");
    }

    public static String value (Integer value) {
        for (WaresTypeEnum item : WaresTypeEnum.values()) {
            if (item.getValue().equals(value)) {
                return item.getDesc();
            }
        }
        return null;
    }
}
